package com.qf.business.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.data.user.entity.RedEnvelopesDetails;
import org.apache.ibatis.annotations.Update;

/**
 * (RedEnvelopesDetails)表数据库访问层
 *
 * @author makejava
 * @since 2022-07-20 10:21:24
 */
public interface RedEnvelopesDetailsMapper extends BaseMapper<RedEnvelopesDetails> {

    @Update("update red_envelopes_details set type = 1 where id = (" +
            "  select t.id from (select * from red_envelopes_details where rid = #{redid}) t order by t.score desc, t.create_time asc limit 1)")
    int updateDetailsType(long redid);
}


